using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using MoEngine;

namespace MoGameLib
{
    public class Site
    {
        protected SiteCollection m_SubSites = new SiteCollection();

        public SiteCollection SubSites
        {
            get { return m_SubSites; }
        }

        protected SiteType m_Type;

        public SiteType Type
        {
            get { return m_Type; }
        }

        protected string m_GameName = null;

        public virtual string GameName
        {
            get { return m_GameName != null ? m_GameName : Type.GameName; }
        }

        public virtual Texture2D Icon
        {
            get { return Type.Icon; }
        }

        public virtual Texture2D Sprite
        {
            get { return Type.Sprite; }
        }

        public Site(Name typeName)
        {
            m_Type = MoCore.World.SiteTypes[typeName];
        }

        public Site(Name typeName, string gameName)
            : this(typeName)
        {
            m_GameName = gameName;
        }

        public Window CreateListItem(WindowBase parent)
        {
            return m_Type.CreateSiteListItem(parent, this);
        }
    }
}
